#pragma once

#ifndef FPGA_IO_H_
#define FPGA_IO_H_

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/****************************************************************************************
* 宏定、常量、结构定义
*****************************************************************************************/

typedef enum _EHardVer_
{
	HARDWARE_VER_S_V_NONE = 0x0000,
	HARDWARE_VER_S_V1 = 0x0001,
	HARDWARE_VER_S_V2 = 0x0002
}EHardVer;


typedef struct _TFpgaVersion_
{
	uint32_t	date;
	uint32_t	time;
	uint32_t	ver;			// 
}TFpgaVersion;


EHardVer get_hardware_ver(void);

const TFpgaVersion *fpga_get_version(void);

int fpga_register_open(void);

int fpga_register_close(void);

unsigned int fpga_register_get(int offset);

void fpga_register_set(int offset, unsigned int val);

void fpga_register_and(int offset, unsigned int val);

void fpga_register_or(int offset, unsigned int val);

void fpga_register_xor(int offset, unsigned int val);


#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
